package vip.xiaonuo.henhouse.modular.henhouse.service.impl.util;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author
 * @date 2023/11/17、14:03
 */
@Setter
@Getter
@NoArgsConstructor
public class TreeNode {
    /* 名称 */
    private String label;
    /* 键值 */
    private String value;
    /* 子节点 */
    private List<TreeNode> children;

    public TreeNode(String label, String value) {
        this.label = label;
        this.value = value;
        this.children = new ArrayList<>();
    }

    //添加子节点
    public void addChild(TreeNode treeNode){
        this.children.add(treeNode);
    }

}
